package com.gxa.ssm340.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.gxa.ssm340.common.R;
import com.gxa.ssm340.entity.vo.UserLoginVO;
import com.gxa.ssm340.exception.BizException;
import com.gxa.ssm340.service.UserLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: huanlianchaoshi
 * @Author: Donglu
 * @CreateTime: 2023-10-20  16:46
 */
@Api(value = "UserLoginController",tags = "用户管理接口")
@RequestMapping("/user")
@RestController
public class UserLoginController {

    @Autowired
    private UserLoginService userLoginService;

    @ApiOperation("用户登录操作方法")
    @PostMapping("/login")
    public R login(String phone) throws BizException, JsonProcessingException {
        UserLoginVO userLoginVO = userLoginService.login(phone);
        return R.success(userLoginVO);
    }
}
